package com.csjbot.blackgaga.model.http.product;

import com.csjbot.blackgaga.cart.entity.RobotMenuListBean;
import com.csjbot.blackgaga.cart.entity.RobotSpListBean;
import com.csjbot.blackgaga.cart.pactivity.evaluate.AnswerResponse;
import com.csjbot.blackgaga.model.http.bean.AdInfo;
import com.csjbot.blackgaga.model.http.bean.PayResponse;
import com.csjbot.blackgaga.model.http.bean.PayResult;
import com.csjbot.blackgaga.model.http.bean.ProductInfo;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.Url;

/**
 * Created by jingwc on 2017/9/18.
 */

public interface ProductService {
    /**
     * 获取产品信息
     */
    @GET("api/pdt/getRobotProductInfo")
    Observable<ProductInfo> getProductInfo();

    /**
     * 获取广告信息
     */
    @GET("api/pdt/getADInfo")
    Observable<AdInfo> getAdInfo();

    /**
     * 支付订单生成请求接口
     *
     * @param body body里面是一个自己生成的Json字符串
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @POST("api/pdt/addOrder")
    Observable<PayResponse> generateOrder(@Body RequestBody body);

    /**
     * 将评价传到后台
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @POST("csjbotservice/eva/save")
    Observable<AnswerResponse> sendEvalution(@Body RequestBody body);

    /**
     * 显示订单信息
     *
     * @param orderid
     * @return
     */
    @GET("api/pdt/showOrderInfo")
    Observable<PayResult> searchPayResult(@Query("orderid") String orderid);


    /**
     * @return
     */
    @GET("api/pdt/getRobotMenuList")
    Observable<RobotMenuListBean> getRobotMenuList(@Query("sn") String msg,@Query("language") String language);

    /**
     * @param msg 动态url
     * @param sn
     * @return
     */
    @GET("{msg}")
    Observable<RobotSpListBean> dynamicGetRobotSpList(@Path("msg") String msg, @Query("sn") String sn);

    /**
     * @param url 全动态url
     * @return
     */
    @GET
    Observable<RobotSpListBean> fullDynamicGetRobotSpList(@Url String url);

    /**
     * 下载图片
     * @param url
     * @return
     */
    @GET
    Observable<ResponseBody> getProductImage(@Url String url);

    /**
     * 下载图篇压缩包
     * @param url
     * @return
     */
    @GET
    Observable<ResponseBody> getProductZip(@Url String url);
}
